﻿using System.IO.Pipes;

namespace IoTSignalR.Server
{
    internal class Program
    {
        static async Task Main(string[] args)
        {
            var childPath = "D:\\灵燕云空间\\自研框架\\io-tsignal-r\\IoTSignalR\\IoTSignalR.Child\\bin\\Debug\\net8.0\\IoTSignalR.Child.exe";
            //协议声明
            AnonymousPipeProtocol anonymousPipeProtocol = new AnonymousPipeProtocol(childPath, 1);
            NamePipeProtocol namePipeProtocol = new NamePipeProtocol("mytest");
            //通信中心（中介者模式+观察者模式）
            ProtocolMediator protocolMediator = new ProtocolMediator();
            protocolMediator.RegisterProtocol(ProtocolEnum.AnonymousPipe, anonymousPipeProtocol);
            protocolMediator.RegisterProtocol(ProtocolEnum.NamePipe, namePipeProtocol);
            Console.ReadKey();
        }
    }
}
